home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10870 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: hubcap.clemson.edu!hubcap!mjs
  2. From: mjs@hubcap.clemson.edu (M. J. Saltzman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: floats in borland C++ 4.5
  5. Date: 18 Mar 96 01:42:48 GMT
  6. Organization: Clemson University
  7. Message-ID: <mjs.827113368@hubcap>
  8. References: <4if2ec$scg@bertrand.ccs.carleton.ca> <827086760snz@genesis.demon.co.uk> <4ii7co$18j@bertrand.ccs.carleton.ca>
  9. NNTP-Posting-Host: hubcap.clemson.edu
  10. X-Newsreader: NN version 6.5.0 #1
  11.  
  12. abelo@chat.carleton.ca (Andrew Belo) writes:
  13.  
  14. |> >void bubblesort( double *dblarray, int numberOfElements)
  15. |> >{
  16. |> >        int top, search, temp; 
  17. |> >[...]
  18. |> >                        {
  19. |> >                                temp = dblarray[search];
  20. |> >                                dblarray[search] = dblarray[top];
  21. |> >                                dblarray[top] = temp; 
  22. |> >                        }
  23. |> >}
  24.  
  25. | [...]
  26.  
  27. |I have however found that if I go to the target expert and make it a
  28.                                           ^^^^^^^^^^^^^ I assume this is
  29.                             a Borlandism.
  30. |floating point program it works fine!
  31.  
  32. Umm, no, it doesn't, although it may *appear* to work fine in some
  33. circumstances.  At the very least, you need to declare temp to be a
  34. double.
  35. -- 
  36.         Matthew Saltzman
  37.         Clemson University Math Sciences
  38.         mjs@clemson.edu
  39.